package com.xhsj.user.pms.patent.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xhsj.user.hr.process.dto.pam.TransferPCTOrPRCDataDto;
import com.xhsj.user.pms.patent.domain.Disclosure;
import com.xhsj.user.pms.patent.domain.IprWorkLoad;
import com.xhsj.user.pms.patent.domain.OpinionsAndFile;
import com.xhsj.user.pms.patent.domain.TbPamJudgesReviewRecord;
import com.xhsj.user.pms.patent.dto.PatentByArchivesNumDto;
import com.xhsj.user.pms.patent.dto.PatentByModelTypeDto;
import com.xhsj.user.pms.patent.query.TransferPCTOrPRCDataQuery;
import com.xhsj.user.utils.Message;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Auther: 罗季嘉
 * @Date: 2020/1/16 15:42
 */
public interface DisclosureService {

    /**
     * 创建交底书
     * @param disclosure
     */
    void createDisclosureAndFile(Disclosure disclosure, Long users, String label, int jumpForm, String roleKeyname, String deptName) throws Exception;

    /**
     * 查询我的专利列表
     * @param userId
     * @return
     */
    IPage<Disclosure> selectMyPatentList(IPage page, Long userId, Map<String, Object> param, String roleKeyname);

    /**
     * 查询交底书编号是否存在
     * @param num
     * @return
     */
    Integer getNumCount(String num);

    /**
     * 查询最新编号并+1
     * @return
     */
    String getNewNum();

    /**
     * 通过主键ID查询交底书以及文件
     * @param disclosureId
     * @return
     */
    Disclosure getDisclosureByDisclosureId(String disclosureId, Integer fileType);

    Map<String,List<OpinionsAndFile>> getOpinions(String disclosureId);

    /**
     * 获取部门集合
     * @return
     */
    List<Map<String, Object>> getDeptAll();

    //    技术交底书
    List<Map<String, Object>> getTechnologyDisclosure(String disclosureId);

    List<Disclosure> getDisclosureByStatusId(String statusId);

    Map<String, Object> getDisclosureDetailPlanToWrite(String disclosureId);

    /**
     * 选择意见列表
     * @author 苏小林
     * @date 2020/2/26 13:51
     * @param: disclosureId
     * @return: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
     */
    List<Map<String, Object>> selectOpinion(String disclosureId);

    /**
     * 获取完整申请文件编写数据
     * @author 苏小林
     * @date 2020/2/26 17:29
     * @param: disclosureId
     * @return: java.util.Map<java.lang.String,java.lang.Object>
     */
    Map<String, Object> getCompleteApplyFileData(String disclosureId);

    /**
     * 获取提交记录前查询专利数据
     * @author 苏小林
     * @date 2020/2/27 10:18
     * @param: disclosureId
     * @return: java.util.Map<java.lang.String,java.lang.Object>
     */
    Map<String, Object> getBeforeSubmitRecordData(String disclosureId);

    /**
     * 发明人回复专利撰写人数据查询
     * @author 苏小林
     * @date 2020/2/27 10:51
     * @param: disclosureId
     * @return: java.util.Map<java.lang.String,java.lang.Object>
     */
    Map<String, Object> inventorReplyCreateUser(String disclosureId);

    /**
     * 获取交底书重新提交数据
     * @author 苏小林
     * @date 2020/3/2 15:38
     * @param: disclosureId
     * @return: java.util.Map<java.lang.String,java.lang.Object>
     */
    Map<String, Object> getDisclosureResubmitData(String disclosureId);

    /**
     * 获取IPR查新数据
     * @author 苏小林
     * @date 2020/3/4 9:10
     * @param: disclosureId
     * @param: fileType
     * @param: i
     * @return: com.alibaba.fastjson.JSONObject
     */
    Disclosure getIprCxData(String disclosureId, Integer fileType);

    /**
     * 创建人回复IPR沟通记录
     * @author 苏小林
     * @date 2020/3/4 11:21
     * @param: disclosureId
     * @return: java.util.Map<java.lang.String,java.lang.Object>
     */
    Map<String, Object> getCreatorReplyIprData(String disclosureId);
//    各个级别页面查看
    Map<String, Object> getWorkFlowRecord(String disclosureId, Long createdUser, Long userId, String roleName);
//    多人审核申请文件列表
    List<Map<String,Object>> getManyPeopleFile(String disclosureId);
//    多人审核查看页面
  Map<String,Object>  getManyPeopleExamineData(String disclosureId, String userId, String patentFileId, String type);
 //饼状图数据
    List<Map<String, Object>> getNumData(String typeParam, int type);
//    报表柱状图个人
    List<Map<String, Object>> getNumDataByUser(String typeParam, String typeKinds, int type);
//    根据报表得到对应的具体数据
    List<Map<String, Object>> getDatasByUser(String userId, String typeKinds, int type);
//    交底书所有数据总数
    int getDisclosureTotal();

    List<Map<String,Object>> getPhaseStatus();

    Integer disclosureTotalByType(String type, String typeParam, String typeKinds);

    // 报表饼状图
    List<Map<String, Object>> getPieNumData(Map<String,Object> param);
    // 保存回复评审会意见
    Message replayJudgesOpinion(TbPamJudgesReviewRecord tbPamJudgesReviewRecord);

    // 通过主键ID查询交底书以及文件-评审会初审
    Disclosure firstReviewTrial(String disclosureId, List<Integer> fileTypeList, List<Integer> checkTypeList);

    // 查询ipr当前工作量
    List<IprWorkLoad> getIprWorkload();

    // 冻结专利和解冻专利
    void disclosureFrozenStatus(int frozenStatus, String disclosureId,String frozenRemarks) throws Exception;

    /**
     * 获取初审数据
     * @author 苏小林
     * @date 2021/1/11 15:41
     * @param: disclosureId
     * @return: com.xhsj.user.pms.patent.domain.Disclosure
     */
    Disclosure getFirstTrialData(String disclosureId,Integer fileType);

    // 获取pct or prc数据
    List<TransferPCTOrPRCDataQuery> getTransferPCTOrPRCData(List<TransferPCTOrPRCDataDto> data);

    void test(List<TransferPCTOrPRCDataDto> data);

    IPage<Map<String, Object>> getPatentByArchivesNum(PatentByArchivesNumDto param);

    List<Map<String,String>> getPatentByModelType(PatentByModelTypeDto param);

    List<Map<String, Object>> getPatentStatistics(String date);
}
